<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>robot_interfaces: robot_interfaces::RobotDriver&lt; Action, Observation &gt; Class Template Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">robot_interfaces
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('classrobot__interfaces_1_1RobotDriver.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="classrobot__interfaces_1_1RobotDriver-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">robot_interfaces::RobotDriver&lt; Action, Observation &gt; Class Template Reference<span class="mlabels"><span class="mlabel">abstract</span></span></div>  </div>
</div><!--header-->
<div class="contents">

<p>Driver for interfacing the actual robot hardware or simulation.  
 <a href="classrobot__interfaces_1_1RobotDriver.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="robot__driver_8hpp_source.html">robot_driver.hpp</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for robot_interfaces::RobotDriver&lt; Action, Observation &gt;:</div>
<div class="dyncontent">
<div class="center"><img src="classrobot__interfaces_1_1RobotDriver__inherit__graph.png" border="0" usemap="#robot__interfaces_1_1RobotDriver_3_01Action_00_01Observation_01_4_inherit__map" alt="Inheritance graph"/></div>
<map name="robot__interfaces_1_1RobotDriver_3_01Action_00_01Observation_01_4_inherit__map" id="robot__interfaces_1_1RobotDriver_3_01Action_00_01Observation_01_4_inherit__map">
<area shape="rect" id="node2" href="classrobot__interfaces_1_1MonitoredRobotDriver.html" title="Wrapper for RobotDriver that monitors timing. " alt="" coords="5,95,236,136"/>
</map>
<center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a251cdab16035ce1cff9ee4d2465beb6c"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classrobot__interfaces_1_1RobotDriver.html#a251cdab16035ce1cff9ee4d2465beb6c">initialize</a> ()=0</td></tr>
<tr class="memdesc:a251cdab16035ce1cff9ee4d2465beb6c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize the robot.  <a href="#a251cdab16035ce1cff9ee4d2465beb6c">More...</a><br /></td></tr>
<tr class="separator:a251cdab16035ce1cff9ee4d2465beb6c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a21e8e2ef50bcf6174c8e76c48975a232"><td class="memItemLeft" align="right" valign="top">virtual Action&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classrobot__interfaces_1_1RobotDriver.html#a21e8e2ef50bcf6174c8e76c48975a232">apply_action</a> (const Action &amp;desired_action)=0</td></tr>
<tr class="memdesc:a21e8e2ef50bcf6174c8e76c48975a232"><td class="mdescLeft">&#160;</td><td class="mdescRight">Apply action immediately and block until it is executed.  <a href="#a21e8e2ef50bcf6174c8e76c48975a232">More...</a><br /></td></tr>
<tr class="separator:a21e8e2ef50bcf6174c8e76c48975a232"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0df4bf715f56b469f0d6c052c4a68a21"><td class="memItemLeft" align="right" valign="top">virtual Observation&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classrobot__interfaces_1_1RobotDriver.html#a0df4bf715f56b469f0d6c052c4a68a21">get_latest_observation</a> ()=0</td></tr>
<tr class="memdesc:a0df4bf715f56b469f0d6c052c4a68a21"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the latest observation immediately.  <a href="#a0df4bf715f56b469f0d6c052c4a68a21">More...</a><br /></td></tr>
<tr class="separator:a0df4bf715f56b469f0d6c052c4a68a21"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a48920e112a572f401194e9d15ed170f6"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a48920e112a572f401194e9d15ed170f6"></a>
virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classrobot__interfaces_1_1RobotDriver.html#a48920e112a572f401194e9d15ed170f6">shutdown</a> ()=0</td></tr>
<tr class="memdesc:a48920e112a572f401194e9d15ed170f6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Shut down the robot safely. <br /></td></tr>
<tr class="separator:a48920e112a572f401194e9d15ed170f6"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><h3>template&lt;typename Action, typename Observation&gt;<br />
class robot_interfaces::RobotDriver&lt; Action, Observation &gt;</h3>

<p>Driver for interfacing the actual robot hardware or simulation. </p>
<p>Interface to the robot used by the subsequent classes. Any robot (be it real or simulation) has to derive from this class and implement the functions <a class="el" href="classrobot__interfaces_1_1RobotDriver.html#a21e8e2ef50bcf6174c8e76c48975a232" title="Apply action immediately and block until it is executed. ">apply_action()</a>, <a class="el" href="classrobot__interfaces_1_1RobotDriver.html#a0df4bf715f56b469f0d6c052c4a68a21" title="Return the latest observation immediately. ">get_latest_observation()</a> and <a class="el" href="classrobot__interfaces_1_1RobotDriver.html#a48920e112a572f401194e9d15ed170f6" title="Shut down the robot safely. ">shutdown()</a>. This Base class provides some timing logic around those three functions. It makes sure that after the first call of <a class="el" href="classrobot__interfaces_1_1RobotDriver.html#a21e8e2ef50bcf6174c8e76c48975a232" title="Apply action immediately and block until it is executed. ">apply_action()</a>, it is always called again after some specified time, otherwise the <a class="el" href="classrobot__interfaces_1_1RobotDriver.html#a48920e112a572f401194e9d15ed170f6" title="Shut down the robot safely. ">shutdown()</a> method will be called. This Base class also makes sure that the <a class="el" href="classrobot__interfaces_1_1RobotDriver.html#a21e8e2ef50bcf6174c8e76c48975a232" title="Apply action immediately and block until it is executed. ">apply_action()</a> function itself does not take more time than expected.</p>
<dl class="tparams"><dt>Template Parameters</dt><dd>
  <table class="tparams">
    <tr><td class="paramname">Action</td><td></td></tr>
    <tr><td class="paramname">Observation</td><td></td></tr>
  </table>
  </dd>
</dl>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a21e8e2ef50bcf6174c8e76c48975a232"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Action , typename Observation &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual Action <a class="el" href="classrobot__interfaces_1_1RobotDriver.html">robot_interfaces::RobotDriver</a>&lt; Action, Observation &gt;::apply_action </td>
          <td>(</td>
          <td class="paramtype">const Action &amp;&#160;</td>
          <td class="paramname"><em>desired_action</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Apply action immediately and block until it is executed. </p>
<p>This method must apply the desired_action immediately when it is called, and only return once the action has been executed completely. This way we can accommodate both simulators and real robots with this interface.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">desired_action</td><td>The action we want to apply. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The action that was actually applied (since due to safety reasons it might not be possible to apply the desired action). </dd></dl>

<p>Implemented in <a class="el" href="classrobot__interfaces_1_1MonitoredRobotDriver.html#a745e701e6fd91be74be5022752ba3ef9">robot_interfaces::MonitoredRobotDriver&lt; Action, Observation &gt;</a>.</p>

</div>
</div>
<a class="anchor" id="a0df4bf715f56b469f0d6c052c4a68a21"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Action , typename Observation &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual Observation <a class="el" href="classrobot__interfaces_1_1RobotDriver.html">robot_interfaces::RobotDriver</a>&lt; Action, Observation &gt;::get_latest_observation </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Return the latest observation immediately. </p>
<dl class="section return"><dt>Returns</dt><dd>Observation </dd></dl>

<p>Implemented in <a class="el" href="classrobot__interfaces_1_1MonitoredRobotDriver.html#a5fcda4be4d96bb803bf87d1b1588079e">robot_interfaces::MonitoredRobotDriver&lt; Action, Observation &gt;</a>.</p>

</div>
</div>
<a class="anchor" id="a251cdab16035ce1cff9ee4d2465beb6c"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Action , typename Observation &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void <a class="el" href="classrobot__interfaces_1_1RobotDriver.html">robot_interfaces::RobotDriver</a>&lt; Action, Observation &gt;::initialize </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Initialize the robot. </p>
<p>Any initialization procedures that need to be done before sending actions to the robot should be done in this method (e.g. homing to find the absolute position). </p>

<p>Implemented in <a class="el" href="classrobot__interfaces_1_1MonitoredRobotDriver.html#a9e1dcc67c242a108b23dfd2bdd8f12a0">robot_interfaces::MonitoredRobotDriver&lt; Action, Observation &gt;</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>/workspace/software/workspace/src/catkin/robots/robot_interfaces/include/robot_interfaces/<a class="el" href="robot__driver_8hpp_source.html">robot_driver.hpp</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><b>robot_interfaces</b></li><li class="navelem"><a class="el" href="classrobot__interfaces_1_1RobotDriver.html">RobotDriver</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.11 </li>
  </ul>
</div>
</body>
</html>
